package com.college.services;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.stereotype.Service;

import com.college.interfaces.IIconNavigationConstants;
import com.college.interfaces.IconNavigationService;

@Service
public class IconNavigationServiceImpl implements IIconNavigationConstants, IconNavigationService {

	
	LinkedHashMap<String,String> iconNavigationMap = new LinkedHashMap<String, String>();
	
	public LinkedHashMap<String, String> getIconNavigationBasedOnRole(Set<GrantedAuthority> roles){
		for(GrantedAuthority authorities:roles){
		if(authorities.equals("ROLE_USER")){
			iconNavigationMap.put(FACULTY_IMG_URL,FACULTY_IMG_TITLE_FOOTER );
			iconNavigationMap.put(STUDENT_IMG_URL, STUDENT_IMG_TITLE_FOOTER);
			iconNavigationMap.put(ROLES_IMG_URL, ROLES_IMG_TITLE_FOOTER);
			iconNavigationMap.put(ATTENDANCE_IMG_URL, ATTENDANCE_IMG_TITLE_FOOTER);
			iconNavigationMap.put(EXAMS_IMG_URL, EXAMS_IMG_TITLE_FOOTER);
			iconNavigationMap.put(TIME_TABLE_IMG_URL, TIME_TABLE_TITLE_FOOTER);
			iconNavigationMap.put(REPORTS_IMG_URL, REPORTS_TITLE_FOOTER);
			iconNavigationMap.put(CONFIG_IMG_URL, CONFIG_TITLE_FOOTER);
		}
		}
		return iconNavigationMap;
		
	}
}
